<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head >
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style>
        body {  font-size:12px;}
        table{border:0px;  margin:5px auto; font-size:12px;}
        .histogram{ height:20px; background:green; margin:0px;}
        .pager_container{ width: 90%; }
        .pager_container div{width: 30px; height: 30px; border:1px solid #fdfdfd; float:left; margin-left: 10px;color:black; text-align: center; border: 1px solid #cccccc;}
        .pager_container a{text-decoration: none;  display: block; font-size: 12px; color: #4997da; margin-top: 7px;}
        .pager_container a:hover{ background:#cccccc; color:white;}
        .pager_current{ background:#cccccc; color:white;width: 30px; height: 30px; font-weight: bold; }
        .categoryTable{ background: #f1f8ff;border: 2px #86c3f7 solid;}
        .categoryTable td{ height: 30px; border-bottom: 1px #cccccc dotted; padding-left: 5px;}
        .fristCate{
            font-size: 12px; font-weight: bold; color: #4997da;text-decoration: none;
        }
        .fristCate:hover{
            text-decoration: underline;
        }
        .notFristCate{
            font-size: 10px;  color: #4997da;text-decoration: none;

        }
        .appTable td{
            border-bottom: 1px #cccccc dotted; padding-left: 5px; padding-top: 3px; padding-bottom: 0px;
            padding-left: 10px; padding-right: 10px;
        }
        .appTable .tbHead{
            background: #eee;
            line-height: 20px;
            vertical-align: middle;
            border-bottom: 1px solid #000;
        }
        .appTitle{
            font-size: 14px;  color: #4997da;text-decoration: none;

        }
        .appTable td p{
            color: #666666; line-height: 20px;
        }
        #btnAllService{
            display: block;
            width: 100px;
            height: 20px;
            text-align: center; 
            background: #86c3f7;
            font-size: 14px;
            text-decoration: none;
            color: white;
            font-weight: bold;

        }
        #btnAllService:hover{
            color:black;

        }
    </style>

</head>
<body>
<table width="1000px" >
    <tr>
        <td width="100px" valign="middle"> 
            <a href="<?php echo U('index','index')?>" id="btnAllService">按分类查看</a>
        </td>
        <td > 
            <?php
                function getCountById($id){
                    $s = new Model_Service();
                    $s -> category  = $id;
                    $cnt = $s -> getTotalNums();
                    if($cnt != 0){
                        return '('.$cnt.')';
                    }
                }
                function getCateById($id){
                    $c = new Model_Category();
                    $c -> loadById($id);
                    return $c->category;
                }
            ?>
        </td>

    </tr>
</table>
<table width="1000px"   cellspacing=1 cellpadding=1 >
    <tr>
        <td valign="top" width="100%">
            <table class="appTable" border="0" align="left">
                <tr class="tbHead">
                    <td>图标</td><td>名字</td><td>免费用量</td><td>付费用量</td><td>总量</td><td>浏览量</td>
                </tr>
                <?php
                    while(!$serviceData -> isEnd()){
                        $service = $serviceData -> getNext();

                    ?>
                    <tr>
                        <td><img src="<?php echo $service -> img_url?>" width="60" height="60"></td>
                        <td valign="top" width="200px"><a href="<?php echo $service -> url?>" class="appTitle" target="_blank"><?php echo $service -> name?></a>
                            <p><?php echo $service -> desc?></p></td>
                        <td width="480px">&nbsp;</td>
                    </tr>

                    <?php
                }?>
                <tr>
                    <td colspan="3"><?php echo $pagenav?></td>
                </tr>
            </table>
        </td>
    </tr>

    </table>
